import './style.css';
import * as re from "react";
import oe from "react";
var b = function() {
  return b = Object.assign || function(m) {
    for (var x, E = 1, L = arguments.length; E < L; E++) {
      x = arguments[E];
      for (var P in x)
        Object.prototype.hasOwnProperty.call(x, P) && (m[P] = x[P]);
    }
    return m;
  }, b.apply(this, arguments);
};
var xe = { exports: {} }, te = {};
/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var $e;
function yr() {
  if ($e)
    return te;
  $e = 1;
  var n = oe, m = Symbol.for("react.element"), x = Symbol.for("react.fragment"), E = Object.prototype.hasOwnProperty, L = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, P = { key: !0, ref: !0, __self: !0, __source: !0 };
  function M(O, p, D) {
    var g, w = {}, c = null, A = null;
    D !== void 0 && (c = "" + D), p.key !== void 0 && (c = "" + p.key), p.ref !== void 0 && (A = p.ref);
    for (g in p)
      E.call(p, g) && !P.hasOwnProperty(g) && (w[g] = p[g]);
    if (O && O.defaultProps)
      for (g in p = O.defaultProps, p)
        w[g] === void 0 && (w[g] = p[g]);
    return { $$typeof: m, type: O, key: c, ref: A, props: w, _owner: L.current };
  }
  return te.Fragment = x, te.jsx = M, te.jsxs = M, te;
}
var ne = {};
/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var Ve;
function xr() {
  return Ve || (Ve = 1, process.env.NODE_ENV !== "production" && function() {
    var n = oe, m = Symbol.for("react.element"), x = Symbol.for("react.portal"), E = Symbol.for("react.fragment"), L = Symbol.for("react.strict_mode"), P = Symbol.for("react.profiler"), M = Symbol.for("react.provider"), O = Symbol.for("react.context"), p = Symbol.for("react.forward_ref"), D = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), c = Symbol.for("react.lazy"), A = Symbol.for("react.offscreen"), U = Symbol.iterator, B = "@@iterator";
    function z(e) {
      if (e === null || typeof e != "object")
        return null;
      var r = U && e[U] || e[B];
      return typeof r == "function" ? r : null;
    }
    var N = n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
    function f(e) {
      {
        for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), o = 1; o < r; o++)
          t[o - 1] = arguments[o];
        $("error", e, t);
      }
    }
    function $(e, r, t) {
      {
        var o = N.ReactDebugCurrentFrame, l = o.getStackAddendum();
        l !== "" && (r += "%s", t = t.concat([l]));
        var s = t.map(function(a) {
          return String(a);
        });
        s.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, s);
      }
    }
    var V = !1, T = !1, W = !1, y = !1, j = !1, u;
    u = Symbol.for("react.module.reference");
    function R(e) {
      return !!(typeof e == "string" || typeof e == "function" || e === E || e === P || j || e === L || e === D || e === g || y || e === A || V || T || W || typeof e == "object" && e !== null && (e.$$typeof === c || e.$$typeof === w || e.$$typeof === M || e.$$typeof === O || e.$$typeof === p || e.$$typeof === u || e.getModuleId !== void 0));
    }
    function G(e, r, t) {
      var o = e.displayName;
      if (o)
        return o;
      var l = r.displayName || r.name || "";
      return l !== "" ? t + "(" + l + ")" : t;
    }
    function C(e) {
      return e.displayName || "Context";
    }
    function S(e) {
      if (e == null)
        return null;
      if (typeof e.tag == "number" && f("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
        return e.displayName || e.name || null;
      if (typeof e == "string")
        return e;
      switch (e) {
        case E:
          return "Fragment";
        case x:
          return "Portal";
        case P:
          return "Profiler";
        case L:
          return "StrictMode";
        case D:
          return "Suspense";
        case g:
          return "SuspenseList";
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case O:
            var r = e;
            return C(r) + ".Consumer";
          case M:
            var t = e;
            return C(t._context) + ".Provider";
          case p:
            return G(e, e.render, "ForwardRef");
          case w:
            var o = e.displayName || null;
            return o !== null ? o : S(e.type) || "Memo";
          case c: {
            var l = e, s = l._payload, a = l._init;
            try {
              return S(a(s));
            } catch {
              return null;
            }
          }
        }
      return null;
    }
    var X = Object.assign, Z = 0, Re, Ce, _e, Ee, we, Te, Se;
    function ke() {
    }
    ke.__reactDisabledLog = !0;
    function Ge() {
      {
        if (Z === 0) {
          Re = console.log, Ce = console.info, _e = console.warn, Ee = console.error, we = console.group, Te = console.groupCollapsed, Se = console.groupEnd;
          var e = {
            configurable: !0,
            enumerable: !0,
            value: ke,
            writable: !0
          };
          Object.defineProperties(console, {
            info: e,
            log: e,
            warn: e,
            error: e,
            group: e,
            groupCollapsed: e,
            groupEnd: e
          });
        }
        Z++;
      }
    }
    function Xe() {
      {
        if (Z--, Z === 0) {
          var e = {
            configurable: !0,
            enumerable: !0,
            writable: !0
          };
          Object.defineProperties(console, {
            log: X({}, e, {
              value: Re
            }),
            info: X({}, e, {
              value: Ce
            }),
            warn: X({}, e, {
              value: _e
            }),
            error: X({}, e, {
              value: Ee
            }),
            group: X({}, e, {
              value: we
            }),
            groupCollapsed: X({}, e, {
              value: Te
            }),
            groupEnd: X({}, e, {
              value: Se
            })
          });
        }
        Z < 0 && f("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
      }
    }
    var ue = N.ReactCurrentDispatcher, fe;
    function ie(e, r, t) {
      {
        if (fe === void 0)
          try {
            throw Error();
          } catch (l) {
            var o = l.stack.trim().match(/\n( *(at )?)/);
            fe = o && o[1] || "";
          }
        return `
` + fe + e;
      }
    }
    var de = !1, ae;
    {
      var Je = typeof WeakMap == "function" ? WeakMap : Map;
      ae = new Je();
    }
    function Pe(e, r) {
      if (!e || de)
        return "";
      {
        var t = ae.get(e);
        if (t !== void 0)
          return t;
      }
      var o;
      de = !0;
      var l = Error.prepareStackTrace;
      Error.prepareStackTrace = void 0;
      var s;
      s = ue.current, ue.current = null, Ge();
      try {
        if (r) {
          var a = function() {
            throw Error();
          };
          if (Object.defineProperty(a.prototype, "props", {
            set: function() {
              throw Error();
            }
          }), typeof Reflect == "object" && Reflect.construct) {
            try {
              Reflect.construct(a, []);
            } catch (k) {
              o = k;
            }
            Reflect.construct(e, [], a);
          } else {
            try {
              a.call();
            } catch (k) {
              o = k;
            }
            e.call(a.prototype);
          }
        } else {
          try {
            throw Error();
          } catch (k) {
            o = k;
          }
          e();
        }
      } catch (k) {
        if (k && o && typeof k.stack == "string") {
          for (var i = k.stack.split(`
`), _ = o.stack.split(`
`), d = i.length - 1, v = _.length - 1; d >= 1 && v >= 0 && i[d] !== _[v]; )
            v--;
          for (; d >= 1 && v >= 0; d--, v--)
            if (i[d] !== _[v]) {
              if (d !== 1 || v !== 1)
                do
                  if (d--, v--, v < 0 || i[d] !== _[v]) {
                    var F = `
` + i[d].replace(" at new ", " at ");
                    return e.displayName && F.includes("<anonymous>") && (F = F.replace("<anonymous>", e.displayName)), typeof e == "function" && ae.set(e, F), F;
                  }
                while (d >= 1 && v >= 0);
              break;
            }
        }
      } finally {
        de = !1, ue.current = s, Xe(), Error.prepareStackTrace = l;
      }
      var H = e ? e.displayName || e.name : "", J = H ? ie(H) : "";
      return typeof e == "function" && ae.set(e, J), J;
    }
    function qe(e, r, t) {
      return Pe(e, !1);
    }
    function He(e) {
      var r = e.prototype;
      return !!(r && r.isReactComponent);
    }
    function le(e, r, t) {
      if (e == null)
        return "";
      if (typeof e == "function")
        return Pe(e, He(e));
      if (typeof e == "string")
        return ie(e);
      switch (e) {
        case D:
          return ie("Suspense");
        case g:
          return ie("SuspenseList");
      }
      if (typeof e == "object")
        switch (e.$$typeof) {
          case p:
            return qe(e.render);
          case w:
            return le(e.type, r, t);
          case c: {
            var o = e, l = o._payload, s = o._init;
            try {
              return le(s(l), r, t);
            } catch {
            }
          }
        }
      return "";
    }
    var Q = Object.prototype.hasOwnProperty, Oe = {}, je = N.ReactDebugCurrentFrame;
    function se(e) {
      if (e) {
        var r = e._owner, t = le(e.type, e._source, r ? r.type : null);
        je.setExtraStackFrame(t);
      } else
        je.setExtraStackFrame(null);
    }
    function Ke(e, r, t, o, l) {
      {
        var s = Function.call.bind(Q);
        for (var a in e)
          if (s(e, a)) {
            var i = void 0;
            try {
              if (typeof e[a] != "function") {
                var _ = Error((o || "React class") + ": " + t + " type `" + a + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[a] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
                throw _.name = "Invariant Violation", _;
              }
              i = e[a](r, a, o, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
            } catch (d) {
              i = d;
            }
            i && !(i instanceof Error) && (se(l), f("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", o || "React class", t, a, typeof i), se(null)), i instanceof Error && !(i.message in Oe) && (Oe[i.message] = !0, se(l), f("Failed %s type: %s", t, i.message), se(null));
          }
      }
    }
    var Ze = Array.isArray;
    function pe(e) {
      return Ze(e);
    }
    function Qe(e) {
      {
        var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
        return t;
      }
    }
    function er(e) {
      try {
        return De(e), !1;
      } catch {
        return !0;
      }
    }
    function De(e) {
      return "" + e;
    }
    function Ae(e) {
      if (er(e))
        return f("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Qe(e)), De(e);
    }
    var ee = N.ReactCurrentOwner, rr = {
      key: !0,
      ref: !0,
      __self: !0,
      __source: !0
    }, Fe, Le, ve;
    ve = {};
    function tr(e) {
      if (Q.call(e, "ref")) {
        var r = Object.getOwnPropertyDescriptor(e, "ref").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.ref !== void 0;
    }
    function nr(e) {
      if (Q.call(e, "key")) {
        var r = Object.getOwnPropertyDescriptor(e, "key").get;
        if (r && r.isReactWarning)
          return !1;
      }
      return e.key !== void 0;
    }
    function or(e, r) {
      if (typeof e.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
        var t = S(ee.current.type);
        ve[t] || (f('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', S(ee.current.type), e.ref), ve[t] = !0);
      }
    }
    function ir(e, r) {
      {
        var t = function() {
          Fe || (Fe = !0, f("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        t.isReactWarning = !0, Object.defineProperty(e, "key", {
          get: t,
          configurable: !0
        });
      }
    }
    function ar(e, r) {
      {
        var t = function() {
          Le || (Le = !0, f("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
        };
        t.isReactWarning = !0, Object.defineProperty(e, "ref", {
          get: t,
          configurable: !0
        });
      }
    }
    var lr = function(e, r, t, o, l, s, a) {
      var i = {
        $$typeof: m,
        type: e,
        key: r,
        ref: t,
        props: a,
        _owner: s
      };
      return i._store = {}, Object.defineProperty(i._store, "validated", {
        configurable: !1,
        enumerable: !1,
        writable: !0,
        value: !1
      }), Object.defineProperty(i, "_self", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: o
      }), Object.defineProperty(i, "_source", {
        configurable: !1,
        enumerable: !1,
        writable: !1,
        value: l
      }), Object.freeze && (Object.freeze(i.props), Object.freeze(i)), i;
    };
    function sr(e, r, t, o, l) {
      {
        var s, a = {}, i = null, _ = null;
        t !== void 0 && (Ae(t), i = "" + t), nr(r) && (Ae(r.key), i = "" + r.key), tr(r) && (_ = r.ref, or(r, l));
        for (s in r)
          Q.call(r, s) && !rr.hasOwnProperty(s) && (a[s] = r[s]);
        if (e && e.defaultProps) {
          var d = e.defaultProps;
          for (s in d)
            a[s] === void 0 && (a[s] = d[s]);
        }
        if (i || _) {
          var v = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
          i && ir(a, v), _ && ar(a, v);
        }
        return lr(e, i, _, l, o, ee.current, a);
      }
    }
    var he = N.ReactCurrentOwner, Me = N.ReactDebugCurrentFrame;
    function q(e) {
      if (e) {
        var r = e._owner, t = le(e.type, e._source, r ? r.type : null);
        Me.setExtraStackFrame(t);
      } else
        Me.setExtraStackFrame(null);
    }
    var ge;
    ge = !1;
    function be(e) {
      return typeof e == "object" && e !== null && e.$$typeof === m;
    }
    function Ne() {
      {
        if (he.current) {
          var e = S(he.current.type);
          if (e)
            return `

Check the render method of \`` + e + "`.";
        }
        return "";
      }
    }
    function cr(e) {
      {
        if (e !== void 0) {
          var r = e.fileName.replace(/^.*[\\\/]/, ""), t = e.lineNumber;
          return `

Check your code at ` + r + ":" + t + ".";
        }
        return "";
      }
    }
    var Ye = {};
    function ur(e) {
      {
        var r = Ne();
        if (!r) {
          var t = typeof e == "string" ? e : e.displayName || e.name;
          t && (r = `

Check the top-level render call using <` + t + ">.");
        }
        return r;
      }
    }
    function We(e, r) {
      {
        if (!e._store || e._store.validated || e.key != null)
          return;
        e._store.validated = !0;
        var t = ur(r);
        if (Ye[t])
          return;
        Ye[t] = !0;
        var o = "";
        e && e._owner && e._owner !== he.current && (o = " It was passed a child from " + S(e._owner.type) + "."), q(e), f('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, o), q(null);
      }
    }
    function Ie(e, r) {
      {
        if (typeof e != "object")
          return;
        if (pe(e))
          for (var t = 0; t < e.length; t++) {
            var o = e[t];
            be(o) && We(o, r);
          }
        else if (be(e))
          e._store && (e._store.validated = !0);
        else if (e) {
          var l = z(e);
          if (typeof l == "function" && l !== e.entries)
            for (var s = l.call(e), a; !(a = s.next()).done; )
              be(a.value) && We(a.value, r);
        }
      }
    }
    function fr(e) {
      {
        var r = e.type;
        if (r == null || typeof r == "string")
          return;
        var t;
        if (typeof r == "function")
          t = r.propTypes;
        else if (typeof r == "object" && (r.$$typeof === p || r.$$typeof === w))
          t = r.propTypes;
        else
          return;
        if (t) {
          var o = S(r);
          Ke(t, e.props, "prop", o, e);
        } else if (r.PropTypes !== void 0 && !ge) {
          ge = !0;
          var l = S(r);
          f("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", l || "Unknown");
        }
        typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && f("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
      }
    }
    function dr(e) {
      {
        for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
          var o = r[t];
          if (o !== "children" && o !== "key") {
            q(e), f("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", o), q(null);
            break;
          }
        }
        e.ref !== null && (q(e), f("Invalid attribute `ref` supplied to `React.Fragment`."), q(null));
      }
    }
    var Ue = {};
    function ze(e, r, t, o, l, s) {
      {
        var a = R(e);
        if (!a) {
          var i = "";
          (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (i += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
          var _ = cr(l);
          _ ? i += _ : i += Ne();
          var d;
          e === null ? d = "null" : pe(e) ? d = "array" : e !== void 0 && e.$$typeof === m ? (d = "<" + (S(e.type) || "Unknown") + " />", i = " Did you accidentally export a JSX literal instead of a component?") : d = typeof e, f("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", d, i);
        }
        var v = sr(e, r, t, l, s);
        if (v == null)
          return v;
        if (a) {
          var F = r.children;
          if (F !== void 0)
            if (o)
              if (pe(F)) {
                for (var H = 0; H < F.length; H++)
                  Ie(F[H], e);
                Object.freeze && Object.freeze(F);
              } else
                f("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
            else
              Ie(F, e);
        }
        if (Q.call(r, "key")) {
          var J = S(e), k = Object.keys(r).filter(function(mr) {
            return mr !== "key";
          }), me = k.length > 0 ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}";
          if (!Ue[J + me]) {
            var br = k.length > 0 ? "{" + k.join(": ..., ") + ": ...}" : "{}";
            f(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`, me, J, br, J), Ue[J + me] = !0;
          }
        }
        return e === E ? dr(v) : fr(v), v;
      }
    }
    function pr(e, r, t) {
      return ze(e, r, t, !0);
    }
    function vr(e, r, t) {
      return ze(e, r, t, !1);
    }
    var hr = vr, gr = pr;
    ne.Fragment = E, ne.jsx = hr, ne.jsxs = gr;
  }()), ne;
}
(function(n) {
  process.env.NODE_ENV === "production" ? n.exports = yr() : n.exports = xr();
})(xe);
const h = xe.exports.jsx, ye = xe.exports.jsxs;
var Be = "white", Rr = 0, Cr = !1, I;
(function(n) {
  n[n.OneColumn = 1] = "OneColumn", n[n.FourColumns = 4] = "FourColumns", n[n.NineColumns = 9] = "NineColumns", n[n.ThirteenColumns = 13] = "ThirteenColumns", n[n.SixteenColumns = 16] = "SixteenColumns";
})(I || (I = {}));
var Er = function(n) {
  var m = n.layout, x = n.itemStyle, E = n.gridContainerStyle, L = n.selectedItem, P = n.gap, M = P === void 0 ? Rr : P, O = n.selectBgColor, p = O === void 0 ? Be : O, D = n.draggable, g = D === void 0 ? Cr : D, w = n.onSelect, c = n.onLayoutChange, A = n.renderChildNode, U = m, B = oe.useRef(null), z = oe.useState(L), N = z[0], f = z[1];
  m === I.ThirteenColumns && (g = !1);
  var $ = function(u) {
    f(u), w && w(u);
  }, V = function(u) {
    B.current = u.currentTarget, u.dataTransfer.dropEffect = "move";
  }, T = function(u) {
    u.preventDefault();
  }, W = function(u) {
    var R = u.currentTarget, G = B.current;
    if (R != null && R !== G) {
      var C = document.querySelector(".grid-wrapper"), S = document.createElement("div");
      C == null || C.appendChild(S), C == null || C.replaceChild(S, R), C == null || C.replaceChild(R, G), C == null || C.replaceChild(G, S);
    }
  }, y = function() {
    var u;
    switch (m) {
      case I.OneColumn:
        u = 1;
        break;
      case I.FourColumns:
        u = 2;
        break;
      case I.NineColumns:
        u = 3;
        break;
      case I.ThirteenColumns:
      case I.SixteenColumns:
        u = 4;
        break;
      default:
        u = 1;
    }
    return u;
  }, j = function(u) {
    return m === I.ThirteenColumns && u === 0 ? b(b({}, x), {
      gridArea: "1 / 1 / span 2 / span 2",
      width: "100%",
      height: "100%"
    }) : x;
  };
  return oe.useEffect(function() {
    c && c(m);
  }, [m]), h("div", b({
    className: "grid-wrapper",
    style: b({
      display: "grid",
      gridTemplateColumns: "repeat(".concat(y(), ", 0fr)"),
      gap: M
    }, E)
  }, {
    children: Array.from({
      length: U
    }, function(u, R) {
      return h("div", b({
        "data-id": R,
        onClick: function() {
          return $(R);
        },
        draggable: g,
        onDragStart: V,
        onDragOver: T,
        onDrop: W,
        style: b({
          backgroundColor: N === R ? p : Be,
          textAlign: "center",
          cursor: "pointer"
        }, j(R))
      }, {
        children: A(R)
      }), R);
    })
  }));
};
const Y = `.panel{cursor:move;position:fixed;z-index:999;display:none;opacity:0}.panel .content{width:376px;height:210px;background:rgba(255,255,255,.2);backdrop-filter:blur(1.2px);border-radius:8px;position:relative;align-items:center;justify-content:space-evenly;display:flex}.panel .content .direction{width:168px;height:168px;border-radius:50%;background-color:#232324;display:flex;align-items:center;justify-content:center;position:relative;cursor:auto}.panel .content .direction:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s;z-index:-1}.panel .content .direction:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .direction li{width:5px;height:5px;background:rgba(255,255,255,.5);border-radius:50%;list-style:none}.panel .content .direction li:nth-of-type(1){position:absolute;top:42px;left:42px}.panel .content .direction li:nth-of-type(2){position:absolute;bottom:42px;left:42px}.panel .content .direction li:nth-of-type(3){position:absolute;top:42px;right:42px}.panel .content .direction li:nth-of-type(4){position:absolute;bottom:42px;right:42px}.panel .content .direction svg:hover{cursor:pointer}.panel .content .direction svg:nth-of-type(1){position:absolute;top:22px;left:84px;transform:translate(-50%)}.panel .content .direction svg:nth-of-type(1):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(2){position:absolute;top:84px;left:22px;transform:translateY(-50%)}.panel .content .direction svg:nth-of-type(2):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(3){position:absolute;bottom:22px;left:84px;transform:translate(-50%)}.panel .content .direction svg:nth-of-type(3):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction svg:nth-of-type(4){position:absolute;top:84px;right:22px;transform:translateY(-50%)}.panel .content .direction svg:nth-of-type(4):hover path{fill:#5583f5;transition:all .3s}.panel .content .direction .middle{width:56px;height:56px;background:#ffffff;opacity:.2;box-shadow:0 4px 4px rgba(0,0,0,.25);border-radius:50%}.panel .content .zoom{width:140px;height:50px;padding:0 17px;background:#232324;border:1px solid rgba(255,255,255,.12);border-radius:64px;display:flex;align-items:center;justify-content:space-between;cursor:auto}.panel .content .zoom .dec{width:22px;height:22px;border-radius:50%;border:2px solid #656566;position:relative;transition:all .1s}.panel .content .zoom .dec:hover{cursor:pointer;border-color:#5583f5}.panel .content .zoom .dec:before{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:12px;height:2px;background-color:#656566;border-radius:4px;transition:all .1s}.panel .content .zoom .dec:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s}.panel .content .zoom .dec:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .zoom .inc{width:22px;height:22px;border-radius:50%;border:2px solid #656566;position:relative;display:flex;align-items:center;justify-content:center}.panel .content .zoom .inc:hover{cursor:pointer;border-color:#5583f5}.panel .content .zoom .inc:after{content:"";position:absolute;inset:0;border-radius:inherit;opacity:0;box-shadow:0 0 0 8px #fff;transition:.4s}.panel .content .zoom .inc:active:after{box-shadow:none;opacity:.4;transition:0s}.panel .content .zoom .inc .inner:before{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:12px;height:2px;background-color:#656566;border-radius:4px}.panel .content .zoom .inc .inner:after{content:"";display:inline-block;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) rotate(90deg);width:12px;height:2px;background-color:#656566;border-radius:4px}.panel .content .cancel{position:absolute;width:20px;height:20px;top:17px;right:17px}.panel .content .cancel:hover{cursor:pointer;border-radius:4px;background-color:rgba(0,0,0,.06);transition:background-color .4s}.panel .content .cancel:before{content:"";display:block;width:2px;height:20px;background:#c4c4c4;border-radius:2px;position:relative;left:9px;transform:rotate(45deg)}.panel .content .cancel:after{content:"";display:block;width:2px;height:20px;background:#c4c4c4;border-radius:2px;position:relative;left:9px;top:-20px;transform:rotate(-45deg)}.open{display:block;opacity:1;transition:opacity .4s}
`;
var K;
(function(n) {
  n.up = "UP", n.rightUp = "RIGHT_UP", n.right = "RIGHT", n.rightDown = "RIGHT_DOWN", n.down = "DOWN", n.leftDown = "LEFT_DOWN", n.left = "LEFT", n.leftUp = "LEFT_UP";
})(K || (K = {}));
var ce;
(function(n) {
  n[n.dec = 0] = "dec", n[n.inc = 1] = "inc";
})(ce || (ce = {}));
var wr = function(n) {
  var m = n.open, x = n.onCancel, E = x === void 0 ? function() {
  } : x, L = n.onStart, P = L === void 0 ? function() {
  } : L, M = n.onEnd, O = M === void 0 ? function() {
  } : M, p = n.onZoom, D = p === void 0 ? function() {
  } : p, g = n.initPosition, w = g === void 0 ? {} : g, c = n.dropAreaRef, A = re.useRef(!1), U = re.useRef(), B = re.useRef({
    initialX: 0,
    initialY: 0
  }), z = re.useRef(!1);
  re.useEffect(function() {
    if (!!(c != null && c.current)) {
      var T = function(y) {
        y.preventDefault(), y.currentTarget === c.current ? y.dataTransfer.dropEffect = "move" : y.dataTransfer.dropEffect = "none";
      }, W = function(y) {
        if (y.preventDefault(), !!z.current) {
          z.current = !1;
          var j = U.current, u = B.current, R = u.initialX, G = u.initialY;
          j.style.left = y.clientX - R + "px", j.style.top = y.clientY - G + "px", j && (j.style.right = "none", j.style.bottom = "none");
        }
      };
      return c.current.addEventListener("dragover", T), c.current.addEventListener("drop", W), function() {
        var y, j;
        (y = c == null ? void 0 : c.current) === null || y === void 0 || y.removeEventListener("dragover", T), (j = c == null ? void 0 : c.current) === null || j === void 0 || j.removeEventListener("drop", W);
      };
    }
  }, [c == null ? void 0 : c.current]);
  var N = function(T) {
    T.stopPropagation();
    var W = U.current;
    z.current = !0, B.current = {
      initialX: T.clientX - W.offsetLeft,
      initialY: T.clientY - W.offsetTop
    };
  }, f = function(T) {
    A.current = !0, P(T);
  }, $ = function() {
    A.current && (A.current = !1, O());
  }, V = function() {
    A.current && (A.current = !1, O());
  };
  return h("div", b({
    style: b({}, w),
    className: "".concat(Y.panel, " ").concat(m ? Y.open : ""),
    ref: U,
    draggable: !0,
    onDragStart: N,
    onDoubleClick: function(T) {
      return T.stopPropagation();
    }
  }, {
    children: ye("div", b({
      className: Y.content
    }, {
      children: [ye("div", b({
        className: Y.direction
      }, {
        children: [h("svg", b({
          width: "17",
          height: "10",
          viewBox: "0 0 17 10",
          onMouseDown: function() {
            return f(K.up);
          },
          onMouseUp: $,
          onMouseLeave: V
        }, {
          children: h("path", {
            fillRule: "evenodd",
            clipRule: "evenodd",
            d: "M9.30394 0.693722L16.3239 7.56631C16.8147 8.0468 16.8147 8.82583 16.3239 9.30632C16.0882 9.53706 15.7686 9.66669 15.4353 9.66669H1.39531C0.701219 9.66669 0.13855 9.11583 0.13855 8.43632C0.13855 8.11 0.270958 7.79705 0.506645 7.56631L7.52662 0.693722C8.01741 0.213232 8.81315 0.213232 9.30394 0.693722Z",
            fill: "white",
            fillOpacity: "0.9"
          })
        })), h("svg", b({
          width: "11",
          height: "18",
          viewBox: "0 0 11 18",
          onMouseDown: function() {
            return f(K.left);
          },
          onMouseUp: $,
          onMouseLeave: V
        }, {
          children: h("path", {
            fillRule: "evenodd",
            clipRule: "evenodd",
            d: "M1.296 8.12312L8.26121 1.19649C8.74818 0.712227 9.5377 0.712227 10.0247 1.19649C10.2585 1.42905 10.3899 1.74446 10.3899 2.07334L10.3899 15.9266C10.3899 16.6114 9.83161 17.1666 9.14294 17.1666C8.81223 17.1666 8.49506 17.036 8.26121 16.8034L1.296 9.8768C0.809032 9.39254 0.809032 8.60738 1.296 8.12312Z",
            fill: "white"
          })
        })), h("svg", b({
          width: "17",
          height: "10",
          viewBox: "0 0 17 10",
          onMouseDown: function() {
            return f(K.down);
          },
          onMouseUp: $,
          onMouseLeave: V
        }, {
          children: h("path", {
            fillRule: "evenodd",
            clipRule: "evenodd",
            d: "M9.30394 9.30634L16.3239 2.43375C16.8147 1.95326 16.8147 1.17423 16.3239 0.693741C16.0882 0.463002 15.7686 0.333374 15.4353 0.333374H1.39531C0.701219 0.333374 0.13855 0.88423 0.13855 1.56375C0.13855 1.89006 0.270958 2.20301 0.506645 2.43375L7.52662 9.30634C8.01741 9.78683 8.81315 9.78683 9.30394 9.30634Z",
            fill: "white",
            fillOpacity: "0.9"
          })
        })), h("svg", b({
          width: "10",
          height: "18",
          viewBox: "0 0 10 18",
          onMouseDown: function() {
            return f(K.right);
          },
          onMouseUp: $,
          onMouseLeave: V
        }, {
          children: h("path", {
            fillRule: "evenodd",
            clipRule: "evenodd",
            d: "M9.53396 9.87676L2.56874 16.8034C2.08178 17.2877 1.29225 17.2877 0.805287 16.8034C0.571438 16.5708 0.440063 16.2554 0.440063 15.9265L0.440063 2.0733C0.440063 1.38844 0.998343 0.833252 1.68702 0.833252C2.01773 0.833252 2.3349 0.963899 2.56875 1.19645L9.53396 8.12308C10.0209 8.60734 10.0209 9.3925 9.53396 9.87676Z",
            fill: "white",
            fillOpacity: "0.9"
          })
        })), h("li", {}), h("li", {}), h("li", {}), h("li", {}), h("div", {
          className: Y.middle
        })]
      })), ye("div", b({
        className: Y.zoom
      }, {
        children: [h("div", {
          className: Y.dec,
          onClick: function() {
            return D(ce.dec);
          }
        }), h("div", b({
          className: Y.inc,
          onClick: function() {
            return D(ce.inc);
          }
        }, {
          children: h("span", {
            className: Y.inner
          })
        }))]
      })), h("div", {
        className: Y.cancel,
        onClick: E
      })]
    }))
  }));
};
export {
  Er as Grid,
  I as LayoutEnum,
  wr as Ptz
};
